var limsMethod = Gikam.getPageObject({

    getEditListColumns : function() {
        return [ {
            checkbox : true
        }, {
            index : true
        }, {
            field : 'methodCode',
            title : 'T_LIMS_METHOD.METHODCODE',
            validators: ['notEmpty'],
        }, {
            field : 'methodDesc',
            title : 'T_LIMS_METHOD.METHODDESC',
            validators: ['notEmpty'],
        }, {
            field : 'methodType',
            title : 'T_LIMS_METHOD.METHODTYPE',
            editor : true,
            validators : ['notEmpty'],
            type : 'select',
            category: 'sys',
            firstBlank : false,
            param: {
                codeCategoryId: 'sopCategory'
            }
        } ];
    },

    getVersionListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true},{
            field : 'methodVersionDesc',
            title : 'T_LIMS_METHOD_VERSION.METHODVERSIONDESC',
            editor : true,
        }, {
            field : 'methodVersion',
            title : 'T_LIMS_METHOD_VERSION.METHODVERSION',
            editor : true,
        }, {
            field : 'releaseDate',
            title : 'T_LIMS_METHOD_VERSION.RELEASEDATE',
            type : 'date',
            editor : true,
        }, {
            field : 'startDate',
            title : 'T_LIMS_METHOD_VERSION.STARTDATE',
            type : 'date',
            editor : true,
        }, {
            field : 'expDate',
            title : 'T_LIMS_METHOD_VERSION.EXPDATE',
            type : 'date',
            editor : true,
            // onChange : function (field, value, index) {
            //     let datum = this.getData()[index];
            //     if(datum.startDate > value) {
            //         Gikam.alert('T_LIMS_METHOD_VERSION.TIP.DATE_VALIDATOR');
            //         return false
            //     }
            // }
        } ];
    },

    getBaseInfoFormFields : function() {
        return [ {
            field : 'methodCode',
            title : 'T_LIMS_METHOD.METHODCODE',
            validators : [ {type : 'unique', rule : '/secure/basemodule/coredata/methods/action/validate-unique'}, 'notEmpty', 'strLength[0,33]' ],
            preInsert : true
        }, {
            field : 'methodDesc',
            title : 'T_LIMS_METHOD.METHODDESC',
            validators : [ 'strLength[0,99]' ],
            preInsert : true
        }, {
            field : 'methodType',
            title : 'T_LIMS_METHOD.METHODTYPE',
            preInsert : true,
            type : 'select',
            category: 'sys',
            firstBlank : false,
            param: {
                codeCategoryId: 'sopCategory'
            }
        }, ];
    },

    getChooseListColumns : function() {
        return [ {index: true},{
            field : 'methodCode',
            title : 'T_LIMS_METHOD.METHODCODE',
            width : 160
        }, {
            field : 'methodDesc',
            title : 'T_LIMS_METHOD.METHODDESC'
        }];
    },

    baseUrl : IFM_CONTEXT + '/secure/basemodule/coredata/methods',
    versionUrl : IFM_CONTEXT + '/secure/basemodule/coredata/method-versions'
});
